package client;

import java.util.concurrent.*;
import common.ComputedData;

/**
 * A utility class that loads information from a server.
 * @author Fredrik Bystam
 * @version 2011.10.11
 *
 */
public class DataReceiver {
	
	private DataReceiver()	{};
	
	/**
	 * Loads information from the server on a new thread and 
	 * returns the {@link Future} object representing this process.
	 * @return A Future object representing the {@link ComputedData} from the server
	 */
	public static <T> Future<ComputedData<T>> loadComputedData() {
		final ExecutorService executor = Executors.newSingleThreadExecutor();
		return executor.submit(new DataReceiverTask<T>());
	}
	
	/**
	 * A {@link Callable} class that loads information from the server and returns
	 * a {@link ComputedData} object.
	 * @author Fredrik Bystam
	 * @version TODO
	 */
	private static class DataReceiverTask<T> implements Callable<ComputedData<T>> {
		
		@Override public ComputedData<T> call() throws Exception {
			// TODO Auto-generated method stub
			return null;
		}
	}

}
